<template>
  <!-- 到期提醒弹框 -->
  <el-dialog
    :visible.sync="dialogVisible"
    width="590px"
    :before-close="handleClose"
  >
    <div slot="title">
      <i class="el-icon-warning" style="color: #FFAE57; font-size: 18px;"></i>
      <span
        style="color: #333;font-size: 16px; font-weight: bold;"
        class="ml-10"
        >到期提醒</span
      >
    </div>
    <div style="font-size:14px; color: #333; margin-left: 32px;">
      您的账号将于<span style="color:#0066F9; margin: 0 5px 0 5px;">{{
        time
      }}</span
      >到期，为了不影响您的正常使用，请及时联系管理员续费。
    </div>
    <span slot="footer" class="dialog-footer">
      <!-- <el-button @click="handleClose">不再提醒</el-button> -->
      <el-button type="primary" @click="handleClose">我知道了</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false
    };
  },
  computed: {
    orgExpireReminder: {
      get() {
        return this.$store.getters.orgExpireReminder.reminder;
      },
      set(val) {
        this.dialogVisible = val["reminder"];
        this.$store.commit("SET_ORG_EXPIRE_REMINDER", val);
      }
    },
    time: {
      get() {
        return this.$store.getters.orgExpireReminder.time;
      },
      set(val) {
        this.$store.commit("SET_ORG_EXPIRE_REMINDER", val);
      }
    }
  },
  watch: {
    "$store.state.user.orgExpireReminder"(val) {
      this.dialogVisible = val["reminder"];
    }
  },
  mounted() {
    this.dialogVisible = this.orgExpireReminder;
  },
  methods: {
    handleClose() {
      this.orgExpireReminder = { reminder: false };
    }
  }
};
</script>

<style lang="scss" scoped>
.el-dialog__body {
  padding: 10px 20px 30px 20px;
}
</style>
